import request from '@/utils/request'

// 获取员工列表
export function getRoles(params) {
  return request({
    method: 'get',
    url: '/sys/role',
    params
  })
}
// 删除接口
export function delUserRoles(id) {
  return request({
    method: 'delete',
    url: '/sys/role/' + id
  })
}
export function addRole(data) {
  return request({
    method: 'post',
    url: '/sys/role',
    data
  })
}
export function getEidt(id) {
  return request({
    method: 'get',
    url: '/sys/role/' + id
  })
}
export function updataRole(data) {
  return request({
    method: 'put',
    url: '/sys/role/' + data.id,
    data
  })
}
// 获取角色权限详情
export function getRoleDetail(id) {
  return request({
    method: 'get',
    url: '/sys/role/' + id

  })
}
/**
 * 给角色分配权限
 */
export function putAssignPermission(data) {
  return request({
    url: '/sys/role/assignPrem',
    method: 'put',
    data
  })
}
